@@ -674,6 +674,7 @@ impl BillBlockchain {
674674 Ok ( nodes)
675675 }
676676
677+ /// Returns all endorsements for the bill (including anonymous holders)
677678 pub fn get_endorsements_for_bill ( & self , bill_keys : & BillKeys ) -> Vec < Endorsement > {
678679 let mut result: Vec < Endorsement > = vec ! [ ] ;
679680 // iterate from the back to the front, collecting all endorsement blocks
@@ -683,28 +684,26 @@ impl BillBlockchain {
683684 continue ;
684685 }
685686 if let Ok ( Some ( holder_from_block) ) = block. get_holder_from_block ( bill_keys) {
686- // we ignore blocks with an anonymous holder
687- if let BillParticipantBlockData :: Ident ( holder_data) = holder_from_block. holder {
688- result. push ( Endorsement {
689- pay_to_the_order_of : holder_data. clone ( ) . into ( ) ,
690- signed : LightSignedBy {
691- data : holder_from_block. signer . clone ( ) . into ( ) ,
692- signatory : holder_from_block. signatory . map ( |s| {
693- LightBillIdentParticipant {
694- // signatories are always identified people
695- t : ContactType :: Person ,
696- name : s. name ,
697- node_id : s. node_id ,
698- }
699- } ) ,
700- } ,
701- signing_timestamp : block. timestamp ,
702- signing_address : match holder_from_block. signer {
703- BillParticipantBlockData :: Anon ( _) => None ,
704- BillParticipantBlockData :: Ident ( data) => Some ( data. postal_address ) ,
705- } ,
706- } ) ;
707- }
687+ let holder_data = holder_from_block. holder ;
688+ result. push ( Endorsement {
689+ pay_to_the_order_of : holder_data. clone ( ) . into ( ) ,
690+ signed : LightSignedBy {
691+ data : holder_from_block. signer . clone ( ) . into ( ) ,
692+ signatory : holder_from_block. signatory . map ( |s| {
693+ LightBillIdentParticipant {
694+ // signatories are always identified people
695+ t : ContactType :: Person ,
696+ name : s. name ,
697+ node_id : s. node_id ,
698+ }
699+ } ) ,
700+ } ,
701+ signing_timestamp : block. timestamp ,
702+ signing_address : match holder_from_block. signer {
703+ BillParticipantBlockData :: Anon ( _) => None ,
704+ BillParticipantBlockData :: Ident ( data) => Some ( data. postal_address ) ,
705+ } ,
706+ } ) ;
708707 }
709708 }
710709
@@ -729,6 +728,7 @@ impl BillBlockchain {
729728 result
730729 }
731730
731+ /// Returns past endorsees, which can be recoursed against (no recourse blocks, no anon)
732732 pub fn get_past_endorsees_for_bill (
733733 & self ,
734734 bill_keys : & BillKeys ,
0 commit comments